package me.msbj.demo.service.impl;

import lombok.extern.slf4j.Slf4j;
import me.msbj.demo.repository.TestRepository;
import me.msbj.demo.service.TestService;
import me.msbj.entity.TestEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 *
 * @author Administrator
 * @date 2019/4/21
 */
@Service
@Transactional
@Slf4j
public class TestServiceImpl implements TestService {

    @Autowired
    private TestRepository testRepository;

    @Override
    public void create(TestEntity testEntity) {
        testRepository.save(testEntity);
    }

    @Override
    public List<TestEntity> list() {
        return (List<TestEntity>) testRepository.findAll();
    }
}
